<?php

include 'functions.php';


/* sites
skladchina.com
    http://skladchina.com/ucp.php?mode=login
    chapaev/searchsc
    post
        username:11
        password:22
        redirect:./ucp.php?mode=login&sid=05711a596e39f3e5dfd339431c418bfa
        sid:05711a596e39f3e5dfd339431c418bfa
        redirect:index.php
        login:����
 
*/



//$url = "https://ihelper.mts.by/SelfCare/";
//$url = "https://profile.onliner.by/login";
$url = "http://php.tut/curl_login2.php";

$hCurl = curl_init();
curl_setopt_array($hCurl, array(
	CURLOPT_URL         => $url,
	CURLOPT_POST        => 1,
	CURLOPT_POSTFIELDS  => 'username=qqq',
	CURLOPT_COOKIEJAR   => dirname(__FILE__).'/cookie.tmp',
	CURLOPT_COOKIE      => dirname(__FILE__).'/cookie.tmp',
));

//$output1 = curl_exec($hCurl);
//dump($output1);

curl_setopt_array($hCurl, array(
	CURLOPT_URL         => $url,
//	CURLOPT_URL         => 'http://php.tut/curl_login2.php?action=logout',
	CURLOPT_COOKIE      => dirname(__FILE__).'/cookie.tmp',
));

$output2 = curl_exec($hCurl);
dump($output2);


